<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">

<head>
    <link rel="shortcut icon" href="${pageContext.request.contextPath}img/icons/icon-48x48.png"/>

    <title>新闻编辑</title>

    <link href="${pageContext.request.contextPath}/css/app.css" rel="stylesheet">
</head>

<body>
<div class="wrapper">
    <%@include file="../icn/sidebar.jsp" %>
    <div class="main">
        <%@include file="../icn/head.jsp" %>

        <div class="card-body">
            <form action="${pageContext.request.contextPath}/system/news/newsEdit/${news.id}" method="post">
                <div class="form-group row">
                    <label class="col-form-label col-sm-2 text-sm-right">标题</label>
                    <div class="col-sm-8">
                        <input type="text" class="form-control" placeholder="标题" value="${news.title}" name="title">
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-form-label col-sm-2 text-sm-right">作者</label>
                    <div class="col-sm-8">
                        <input type="text" class="form-control" placeholder="作者" value="${news.userInfo.name}"
                               name="userInfo.name">
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-form-label col-sm-2 text-sm-right">内容</label>
                    <div style="width: 54%;border-radius: 5px;margin-left: 1%">
                        <script id="container" name="newsDetail.content" type="text/plain">
                            ${news.newsDetail.content}
                        </script>
                    </div>
                </div>
                <div class="form-group row">
                    <div style="margin-left: 48%">
                        <button type="submit" class="btn btn-primary">提交</button>
                    </div>
                </div>
            </form>
        </div>
    </div>


</div>
<script src="${pageContext.request.contextPath}/ueditor/ueditor.config.js"></script>
<script src="${pageContext.request.contextPath}/ueditor/ueditor.all.min.js"></script>
<script src="${pageContext.request.contextPath}/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
    var ue = UE.getEditor('container');
    ue.ready(function () {
        ue.setHeight(370);
        //设置编辑器的内容
        // ue.setContent('hello');
        // //获取html内容，返回: <p>hello</p>
        // var html = ue.getContent();
        // //获取纯文本内容，返回: hello
        // var txt = ue.getContentTxt();
    });
</script>

<script src="${pageContext.request.contextPath}/js/vendor.js"></script>
<script src="${pageContext.request.contextPath}/js/app.js"></script>

</body>

</html>